//=============================================================================
// AA12 Automatic Shotgun Inventory class
//=============================================================================
class KSGW extends SRKFWeapon;

var globalconfig bool bWideSpread;

replication
{
	reliable if(Role < ROLE_Authority)
		ServerChangeFireMode;
}

// Use alt fire to switch fire modes
simulated function AltFire(float F)
{
	if(ReadyToFire(0))
	{
		DoToggle();
	}
}

// Toggle semi/auto fire
simulated function DoToggle ()
{
	local PlayerController Player;
	Player = Level.GetLocalPlayerController();
	if ( Player!=None )
	{
		//PlayOwnedSound(sound'Inf_Weapons_Foley.stg44_firemodeswitch01',SLOT_None,2.0,,,,false);
		bWideSpread = !bWideSpread;
		if (bWideSpread )
		Player.ReceiveLocalizedMessage(class'PerksSimHostOrg.KSGWSwitchMessage',1);
		else Player.ReceiveLocalizedMessage(class'PerksSimHostOrg.KSGWSwitchMessage',0);
	}
	Super.DoToggle();

	ServerChangeFireMode(bWideSpread);
}

// Set the new fire mode on the server
function ServerChangeFireMode(bool bNewbWideSpread)
{
	bWideSpread = bNewbWideSpread;
}

exec function SwitchModes()
{
	DoToggle();
}

simulated function bool CanZoomNow()
{
	return (!FireMode[0].bIsFiring && Instigator!=None && Instigator.Physics!=PHYS_Falling);
}

defaultproperties
{
     bWideSpread=True
     MagCapacity=12
     ReloadRate=2.830000
     ReloadAnim="Reload"
     ReloadAnimRate=1.000000
     WeaponReloadAnim="Reload_BullPup"
     HudImage=Texture'KSGTextures.Icon.KSGIdle'
     SelectedHudImage=Texture'KSGTextures.Icon.KSGInUse'
     Weight=6.000000
     bHasAimingMode=True
     IdleAimAnim="Idle_Iron"
     StandardDisplayFOV=65.000000
     bModeZeroCanDryFire=True
     SleeveNum=0
     TraderInfoTexture=Texture'KSGTextures.Icon.KSGTrader'
     PlayerIronSightFOV=80.000000
     ZoomedDisplayFOV=45.000000
     FireModeClass(0)=Class'PerksSimHostOrg.KSGWFire'
     FireModeClass(1)=Class'KFMod.NoFire'
     PutDownAnim="PutDown"
     SelectSound=Sound'KF_AA12Snd.AA12_Select'
     SelectForce="SwitchToAssaultRifle"
     AIRating=0.550000
     CurrentRating=0.550000
     bShowChargingBar=True
     Description="An advanced shotgun. Fires steel ball shot in semi auto."
     EffectOffset=(X=100.000000,Y=25.000000,Z=-10.000000)
     DisplayFOV=65.000000
     Priority=100
     InventoryGroup=3
     GroupOffset=12
     PickupClass=Class'PerksSimHostOrg.KSGWPickup'
     PlayerViewOffset=(X=-2.700000,Y=7.800000,Z=-2.000000)
     BobDamping=4.500000
     AttachmentClass=Class'PerksSimHostOrg.KSGWAttachment'
     IconCoords=(X1=245,Y1=39,X2=329,Y2=79)
     ItemName="KSG Shotgun"
     Mesh=SkeletalMesh'KSGAnimations.KSG'
     DrawScale=1.500000
     Skins(1)=Combiner'KSGTextures.KSG.KSGC2'
     Skins(2)=Shader'KSGTextures.KSG.Dot'
     TransientSoundVolume=1.250000
}
